# -*- coding:utf-8 -*-
import sys

import maya.cmds as cmds
import pymel.core as pm
import sys


def init_mz_tool():

    main_window = pm.language.melGlobals['gMainWindow']
    menu_obj = 'CGAI'
    menu_label = 'CGAI'



    if pm.menu(menu_obj,label=menu_label,exists=True,parent=main_window):
        pm.deleteUI(pm.menu(menu_obj,e=True,deleteAllItems=True))
    mz_tool_menu = pm.menu(menu_obj,label=menu_obj,parent=main_window,tearOff=True)

    pm.menuItem(label='Deadline',subMenu=True,parent=mz_tool_menu,tearOff=True)
    pm.menuItem(label=u'提交任务',command="maya_ui()")
    pm.menuItem(label=u'查看任务',command="m_maya_ui()")
    # pm.menuItem(label='T_1',command="maya_ui()")
    # pm.menuItem(label='MOD',subMenu=True,parent=mz_tool_menu,tearOff=True)
    # pm.menuItem(label='ANI',subMenu=True,parent=mz_tool_menu,tearOff=True)
    # pm.menuItem(label='ENV',subMenu=True,parent=mz_tool_menu,tearOff=True)
    # pm.menuItem(label='EFX',subMenu=True,parent=mz_tool_menu,tearOff=True)


cmds.evalDeferred('from maya_deadline import maya_ui') 
cmds.evalDeferred('from maya_monitor import m_maya_ui') 

cmds.evalDeferred('init_mz_tool()')